
//设备品牌
const deviceNumList = [
    {
        label: "海康",
        value: 0,
    },
    {
        label: "大华",
        value: 1,
    }
]
//设备类型
const devTypeList = [
    {
        label: "人脸门禁",
        value: 0,
    },
    {
        label: "车辆道闸",
        value: 1,
    },
    {
        label: "人脸抓拍",
        value: 2,
    }
]
//设备在线状态
const devOnlineStatusList = [
    {
        label: "离线",
        value: 0,
    },
    {
        label: "在线",
        value: 1,
    }
]
//设备使用状态
const devUseStatusList = [
    {
        label: "禁用",
        value: 0,
    },
    {
        label: "启用",
        value: 1,
    }
]
/**
 * 
 * @param value 
 * @param listName 要比对的数组名称 
 * @returns label
 */
const findLabel = (value , listName) => {
    //定义一个 ListType 方便后续进行扩展
    const ListType = {
        'deviceNumList': deviceNumList,//设备品牌
        'devTypeList': devTypeList,//设备类型
        'devOnlineStatusList': devOnlineStatusList,//设备在线状态
        'devUseStatusList': devUseStatusList,//设备使用状态
    };
    let list = ListType[listName];
    let obj = list.find((item) => item.value == value);
    return obj?.label;
}
export { deviceNumList, devTypeList, devOnlineStatusList, devUseStatusList, findLabel }